/**
 * Created by imac13 on 19/1/5.
 */
import React,{ Component } from 'react';
import { Card,Button,notification } from 'antd';
import './../ui.less'

class Notice extends Component {
    openNotification = (type,direction)=> {
        if(direction){
            notification.config({
                placement: 'direction',
            });
        }
        notification[type]({
            message: 'react实战练习',
            description: 'react实战练习已经购买成功，48小时之内会发货！等待签收哦！',
        });
    };
    render(){
        return(
            <div>
                <Card title="通知提醒框" className="card-wrapper">
                    <Button type="primary" onClick={()=>this.openNotification('success')}>Success</Button>
                    <Button type="primary" onClick={()=>this.openNotification('error')}>Error</Button>
                    <Button type="primary" onClick={()=>this.openNotification('info')}>Info</Button>
                    <Button type="primary" onClick={()=>this.openNotification('warning')}>Warning</Button>
                </Card>
                <Card title="通知提醒框" className="card-wrapper">
                    <Button type="primary" onClick={()=>this.openNotification('success','topLeft')}>Success</Button>
                    <Button type="primary" onClick={()=>this.openNotification('error','topRight')}>Error</Button>
                    <Button type="primary" onClick={()=>this.openNotification('info','bottomLeft')}>Info</Button>
                    <Button type="primary" onClick={()=>this.openNotification('warning','bottomRight')}>Warning</Button>
                </Card>
            </div>
        )
    }
}

export default Notice;